<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    // 编写函数，实现任意个任意数字的和
    function sum(){
        // console.log(arguments);
        // console.log(arguments[0]);
        // console.log(arguments[1]);
        // console.log(arguments[2]);
        // console.log(arguments[3]);
        // console.log(arguments[4]);
        // console.log(arguments.length)

        var s = 0;

        for(var i=0;i<arguments.length;i++){
            // console.log(i)
            // console.log(arguments[i]);
            s += arguments[i]
        }

        console.log(s);
    }


    sum(3,4,5,6,7);

    sum(8,6,7);

    sum(8,6,7,9,4,2,7,1,6,4,9);

</script>
</html>